package com.jxs;


class Telephone{
    private String brand;
    private String phoneNumber;
    private int time;
    private double rate;
    private int balance;
    public Telephone(){}
    public Telephone(String brand,String phoneNumber,int time,double rate,int balance){
        this.brand = brand;
        this.phoneNumber = phoneNumber;
        this.time = time;
        this.rate = rate;
        this.balance = balance;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public int getTime() {
        return time;
    }

    public void setTime(int time) {
        this.time = time;
    }

    public double getRate() {
        return rate;
    }

    public void setRate(double rate) {
        this.rate = rate;
    }

    public int getBalance() {
        return balance;
    }
    public void setBalance(int balance) {
        this.balance = balance;
    }
    //    提供计算话费方法
    public double getExpense(){
        return rate * time;
    }
//    提供显示信息方法
    public void getInfo(String phoneNumber){
        System.out.println("手机品牌是"+brand+",话费余额是"+balance+",通话时间是"+time+"分钟");
    }
}
public class TelephoneTest {

//    程序中应包含一个主类来使用Telephone类并显示相应的信息
    public static void main(String[] args) {
        Telephone telephone = new Telephone("小米","13912345678",20,0.5,39);
        double cost = telephone.getExpense();
        System.out.println(cost);
        telephone.getInfo("13912345678");

    }
}
